//****************************************************************/
//Creation History
// Company: GZ office
// NAME:    SysParamProcess.java
// TITLE:   System parameter 
// BY:      Oscar Bai
// DATE:    2003-03-04
//******************************************************************/
//Modification History
//******************************************************************/
//******************************************************************/

package admin.system.sysparam;

import com.ffpc.sql.*;

import java.util.Vector;
import java.sql.*;

import admin.system.sysparam.SysParam;

public class SysParamProcess{

    public static SysParamBean createBean()
    {
        return new SysParam();
    }

    public static int insert(Connection con, SysParamBean sysParamBean)
      throws DataException
    {
        SysParam sysParam = (SysParam)sysParamBean;
        sysParam.setConnection(con);
        return sysParam.insert();
    }

    public static int update(Connection con, SysParamBean sysParamBean)
      throws DataException
    {
        SysParam sysParam = (SysParam)sysParamBean;
        sysParam.setConnection(con);
        return sysParam.update();
    }

    public static int delete(Connection con, SysParamBean sysParamBean)
      throws DataException
    {
        SysParam sysParam = (SysParam)sysParamBean;
        sysParam.setConnection(con);
        return sysParam.delete();
    }

    public static SysParamBean[] find(Connection con, SysParamBean sysParamBean)
      throws DataException
    {
        SysParam sysParam = (SysParam)sysParamBean;
        BaseSqlCommand buc = new BaseSqlCommand(con);
        Vector rows = buc.find(sysParam);
        SysParamBean[] beans = new SysParam[rows.size()];
        for (int i=0;i<rows.size();i++)
        {
            SysParam bean = new SysParam();
            bean.setColumns((Column[])rows.get(i));
            beans[i] = bean;
        }
        return beans;
    }  
}